import pygame

class Home:
    def __init__(self, x, y):
        self.x = x
        self.y = y
        self.normal_image = pygame.image.load("images/home.png")
        self.destroyed_image = pygame.image.load("images/home_destroyed.png")
        self.image = self.normal_image
        self.rect = self.image.get_rect(topleft=(x, y))
        self.destroyed = False
        self.durability = 1

    def draw(self, screen):
        screen.blit(self.image, self.rect)

    def hit(self):
        if self.durability > 0:
            self.durability -= 1
            if self.durability <= 0:
                self.destroyed = True
                self.image = self.destroyed_image
                return True
        return False